package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

/**
 * @Author 江峰
 * @Date 2024/5/30 16:04
 * @packageName:com.sky.mapper
 * @ClassName:UserMapper
 */
@Mapper
public interface UserMapper {

    /**
     * 根据openid查询用户
     * @param openId
     * @return
     */
    @Select("select *from sky_take_out.user where openid=#{openId}")
    User getByOpenId(String openId);

    /**
     * 插入数据
     * @param user
     */
    void insert(User user);

    /**
     *
     * @param userId
     * @return
     */
    @Select("select *from sky_take_out.user where id=#{id}")
    User getById(Long id);

}
